package com.logic.modular.game.battle.panel.skillEffect.domain;

import cn.hutool.core.util.RandomUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import java.util.List;

@Slf4j
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class BaseTrigger {
    @ApiModelProperty("本局技能触发第几次")
    private Integer trigger1;

    @ApiModelProperty("第多少回合触发")
    private Integer trigger2;

    @ApiModelProperty("阶段条件")
    private Integer trigger3;

    @ApiModelProperty("战法类型条件")
    private List<Integer> trigger4;

    @ApiModelProperty("效果类型条件 满足一项即可")
    private List<Long> trigger5;

    @ApiModelProperty("触发目标")
    private Integer trigger6;

    @ApiModelProperty("回合触发次数")
    private Integer triggerNum;

    @ApiModelProperty("指定生效回合")
    private Integer appoint;

    @ApiModelProperty("准备回合")
    public Integer prepare;

    @ApiModelProperty("持续回合")
    private Integer keep;

    @ApiModelProperty("技能效果触发几率")
    private Double resProbability;

    public boolean resProbability() {
        double v = RandomUtil.randomDouble(100.0);
        return v < resProbability;
    }
}
